/*
 *Author: 蔡亚风
 *Date: 2022-04-26 17:37:29
 *LastEditTime: 2022-04-26 17:41:34
 *LastEditors: 蔡亚风
 *Description:解决webm无视频长度的问题
 *FilePath: \jrakiot-jmno-registration-client-h5\src\components\RecorderVideo\js\fix-webm-duration.utils.js
 */
import ysFixWebmDuration from './index'
/*******
 * @description:
 * @param {Blob} blob  需要转换的blob对象
 * @param {Number} duration 从开始到结束记录的时间
 * @return {Blob} 带时间长度的blob
 */
export const fixWebDurationFn = (blob, duration) => {
  return new Promise((reslove, reject) => {
    try {
      ysFixWebmDuration(blob, duration, (fixedBlob) => {
        reslove(fixedBlob)
      })
    } catch (error) {
      reject(error)
    }
  })
}
